package com.kung.qvs.ui.main.fragment;

import androidx.annotation.NonNull;
import androidx.databinding.ObservableField;

import com.kung.qvs.entity.CustomerBean;
import com.kung.qvs.entity.SupplierBean;

import me.goldze.mvvmhabit.base.ItemViewModel;
import me.goldze.mvvmhabit.binding.command.BindingAction;
import me.goldze.mvvmhabit.binding.command.BindingCommand;

public class CustomerManageItemModel extends ItemViewModel<CustomerManageViewModel> {

    public ObservableField<CustomerBean> entity = new ObservableField<>();

    public CustomerManageItemModel(@NonNull CustomerManageViewModel viewModel, CustomerBean bean) {
        super(viewModel);
        this.entity.set(bean);
    }

    public BindingCommand itemDeleteClick = new BindingCommand(new BindingAction() {
        @Override
        public void call() {
            //这里可以通过一个标识,做出判断，已达到跳入不同界面的逻辑
            viewModel.doDeleteDataBean(entity.get());
        }
    });

    public BindingCommand itemEditClick = new BindingCommand(new BindingAction() {
        @Override
        public void call() {

        }
    });
}
